package ken.spring.cloud.alibaba.fallback;

import ken.spring.cloud.alibaba.po.User;
import ken.spring.cloud.alibaba.service.EchoService;

import java.util.List;

/**
 * <ul>
 * <li>Title: EchoServiceFallback</li>
 * <li>Description: TODO </li>
 * </ul>
 *
 * @author swc
 * @date 2022-06-26 14:13
 */
public class EchoServiceFallback  implements EchoService {
    private Throwable throwable;

    public EchoServiceFallback(Throwable throwable) {
        this.throwable = throwable;
    }

    /**
     * 调用服务提供方的输出接口.
     * @param str 用户输入
     * @return String
     */
    //@Override
    public String echo(String str) {
        return "consumer-fallback-default-str" + throwable.getMessage();
    }

    public List<User> queryAll() {
        return null;
    }
}
